package total;

import java.util.Scanner;

/**
 * 请判断给出的n是不是素数？
 * @author chenxiaokang
 *
 */
public class Ques1012 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int n = scan.nextInt();
			String flag = "YES";
			if(n == 2){
				flag = "YES";
			}else if(n == 0 || n == 1){
				flag = "NO";
			}else{
				for(int i = 2;i <= (int)(Math.sqrt(n));i++){
					if(n % i == 0){
						flag = "NO";
					}
				}
			}
			System.out.println(flag);
		}
	}
}
